Ext.define('DDMS.controller.RetrievePwd', {
    extend: 'Ext.app.Controller',
    config: {
        refs: {
            retrieveNestedlistCmp: '#retrieveWin-nestedlist',
            retrievePwdBackCmp: '#retrievePwd-back',
            retrievePwdOkCmp: '#retrievePwd-ok'
        },

        control: {
        	retrieveNestedlistCmp: {
        	  leafitemtap: 'retrieveNestedlistCmptap'
        	},
        	retrievePwdBackCmp: {
        	  tap: 'retrievePwdBackCmptap'
        	},
        	retrievePwdOkCmp: {
        	  tap: 'retrievePwdOkCmptap'
        	}
        }
    },
    retrieveNestedlistCmptap: function(obj, list, index, target, record, e, eOpts) {
      var retrievePwdCmp=Ext.getCmp('retrievePwd');
	  if (!retrievePwdCmp){
	      retrievePwdCmp=Ext.create('DDMS.view.RetrievePwd');
	  } else{
	  	  retrievePwdCmp.reset();
	  }
	  Ext.Viewport.animateActiveItem(retrievePwdCmp,{
	        type: 'slide',
	        direction: 'left',
	        duration: 250
	  });
	  
	  //关闭弹出框
	  var retrieveWinCmp=Ext.getCmp('retrieveWin');
	  if (retrieveWinCmp){
	      retrieveWinCmp.hide();
	  }
    },
    retrievePwdBackCmptap:function(){
    	Ext.Viewport.animateActiveItem(Ext.getCmp('tablet'),{
            type: 'slide',
            direction: 'right',
            duration: 250
    	});
    },
    retrievePwdOkCmptap:function(){
    	Ext.Msg.alert("信息提示","找回密码成功!");
    }
});

function retrieveWin(){
  var retrieveWinCmp=Ext.getCmp('retrieveWin');
  if (!retrieveWinCmp){
      retrieveWinCmp=Ext.create('DDMS.view.RetrieveWin');
  }
  Ext.Viewport.add(retrieveWinCmp);
  
  retrieveWinCmp.show();
}